<script type="text/javascript">

  var sColor = "blue";
  alert(sColor.length);  // "4"


  /***
  * NOTE : toString() is used to convert any datatype to STRING
  **/

  var bFound = false;
  alert(bFound.toString()); //outputs “false”


  var iNum1 = 10;
  var fNum2 = 10.0;
  alert(iNum1.toString()); //outputs "10"
  alert(fNum2.toString()); //outputs "10"


  var iNum = 10;
  alert(iNum1.toString(2));//outputs "1010" i.e.  2  => base of Binary
  alert(iNum1.toString(8));//outputs "12"   i.e.  8  => base of Octal
  alert(iNum1.toString(16));//outputs "A"   i.e.  16 => base of HexaDecimal

</script>

